<template>
  <div class="box" id="attachment">
    <attachment :code="code" :fujianObjList="fujianObjList"></attachment>
  </div>
</template>

<script>
import { queryProjectResultAuditInfo } from '@/api/siteSurveyEarlyStage'
import attachment from '@/components/attachment'
export default {
  components: {
    attachment
  },
  data() {
    return {
      fujianObjList: [],
      code: 'X_C_T_K_Y_Q_Q_C_H'
    }
  },
  mounted() {
    this.getFujian()
  },
  methods: {
    // 获取附件列表
    getFujian() {
      const loadingInstance = this.$loading(this.$loadingData)
      var data = {
        projectId: localStorage.getItem('projectId')
      }
      queryProjectResultAuditInfo(data)
        .then(res => {
          loadingInstance.close()
          if (res.data) {
            var arr = []
            arr.push({ title: '现状图', list: res.data.projectStatusMapList })
            arr.push({
              title: '其他附件',
              list: res.data.projectOtherAccessoryList
            })
            arr.push({ title: '文本数据', list: res.data.projectAccessoryList })
            if (res.data.projectRedLineFile) {
              var hongxianList = []
              hongxianList.push(res.data.projectRedLineFile)
              arr.push({ title: '红线数据', list: hongxianList })
            }
            console.log(arr)
            this.fujianObjList = arr
          }
        })
        .catch(() => {
          loadingInstance.close()
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.box {
  padding: 30px;
}
</style>
